import java.io.UnsupportedEncodingException;
import java.util.Arrays;
public class Main {
    public static void main(String[] args) {
        showException();
    }
    static void showException(){
        byte[] bs= null;
        try {
            bs = toGBK("中文");
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(Arrays.toString(bs));
    }
    static byte[] toGBK(String s) throws UnsupportedEncodingException {
        try {
            return s.getBytes(s);
        } catch (UnsupportedEncodingException e) {
            throw new UnsupportedEncodingException();
        }
    }
}


